package fhp.hlhj.giantfold.module
import com.lzy.okgo.model.HttpParams
import fhp.hlhj.giantfold.javaBean.ForgetBean
import fhp.hlhj.giantfold.javaBean.GetSmsBean
import fhp.hlhj.giantfold.network.UrlApis

/**
 * author: FHP
 * data: on 2018\1\12 0012 11:40
 * E-Mail: 103945089@qq.com
 */
class ForgetModule {
    interface ForgetListener{
        fun smsOver(smsBean: GetSmsBean)
        fun showLoading()
        fun smsOk(forgetBean: ForgetBean)
    }

    fun getSms(params: HttpParams,forgetListener: ForgetListener){
        UrlApis.getSMSCode(params)
                .doOnSubscribe {
                    forgetListener.showLoading()
                }
                .subscribe {
                    data->
                    forgetListener.smsOver(data)
                }
    }

    fun forget1(params: HttpParams,forgetListener: ForgetListener){
        UrlApis.forget1(params)
                .doOnSubscribe {
                    forgetListener.showLoading()
                }
                .subscribe {
                    data->
                    forgetListener.smsOk(data)
                }

    }
}